<template>
  <div class="cart-wrapper">
    <h3>已选商品</h3>
    <ul>
      <template v-for="(item, index) in dataList">
        <li v-bind:key="index">
          <el-checkbox><span>{{item.name}}</span><span>{{item.price}}</span></el-checkbox>
          <el-button type="text" icon="el-icon-delete" @click="remove(index)"></el-button>
        </li>
      </template>
    </ul>
    <el-button type="primary">结算</el-button>
  </div>
</template>
<script>
export default {
  props:{
    dataList: Array,
  },
  data(){
    return {
    }
  },
  methods:{
    remove(index){
      this.dataList.splice(index, 1);
    },
  }
}
</script>


<style>
  .cart-wrapper {
    background:#fff4e8;
    padding:15px;
    margin-top:100px;
    margin-right:50px;
  }
</style>